#ifndef DESIGN_COMMAND_H_
#define DESIGN_COMMAND_H_

#define SLOTSNUMS 7

namespace command{

class Command
{
public:
    virtual void execute() = 0;
};

class RemoteControl
{
public:
    void setCommand(int slot, Command* on, Command* off);
    void onButtonWasPushed(int slot);
    void offButtonWasPushed(int slot);
private:
    Command* onCommands[SLOTSNUMS];
    Command* offCommands[SLOTSNUMS];
};

///////////////////////////////////////////
class Light
{
public:
    void on();
    void off();
};

class Stereo
{
public:
    void on();
    void off();
    void setCd();
    void setDvd();
    void setRadio();
    void setVolume();
};

class Garagedoor
{
public:
    void up();
    void down();
    void stop();
    void lightOn();
    void lightOff();
};
///////////////////////////////////////////
class LightOnCommand : public Command
{
public:
    LightOnCommand(Light* l);
public:
    virtual void execute();
private:
    Light* m_light;
};

class LightOffCommand : public Command
{
public:
    LightOffCommand(Light* l);
public:
    virtual void execute();
private:
    Light* m_light;
};

class StereoOnWithCDCommand : public Command
{
public:
    StereoOnWithCDCommand(Stereo* s);
public:
    virtual void execute();
private:
    Stereo* m_stereo;
};

class StereoOffCommand : public Command
{
public:
    StereoOffCommand(Stereo* s);
public:
    virtual void execute();
private:
    Stereo* m_stereo;
};

class GarageDoorDownCommand : public Command
{
public:
    GarageDoorDownCommand(Garagedoor* g);
public:
    virtual void execute();
private:
    Garagedoor* m_garage;
};

class GarageDoorUpCommand : public Command
{
public:
    GarageDoorUpCommand(Garagedoor* g);
public:
    virtual void execute();
private:
    Garagedoor* m_garage;
};

}
#endif // DESIGN_COMMAND_H_
